package com.demo.api.vo.user;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.demo.client.model.user.SysMenu;
import com.demo.core.annotation.NotBlank;
import com.demo.core.annotation.TableFieldDefaultValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author Tan-Bowen
 * @version 1.0
 * @description TODO
 * @date 2021/8/5 10:44
 */
public class UserLogin implements Serializable {

    private static final long serialVersionUID = -1329586163950018706L;

    @Data
    @Builder
    @ApiModel("用户登录参数")
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Request {


        @NotBlank(message = "登录用户名必填!")
        @ApiModelProperty("用户登录名")
        private String userName;

        @NotBlank(message = "登录密码必填!")
        @ApiModelProperty("密码")
        private String password;
    }

    @Data
    @Builder
    @ApiModel("用户登录参数")
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Response {

        private Long id;

        @ApiModelProperty("用户姓名")
        private String name;

        @ApiModelProperty("用户昵称")
        private String userName;

        @ApiModelProperty("1男 2女")
        private Integer sex;

        @ApiModelProperty("用户电话")
        private String tel;

        @ApiModelProperty("头像地址")
        private String headUrl;

        @ApiModelProperty("最后登录时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date lastLoginTime;

        @ApiModelProperty("最后登录ip")
        private String lastLoginIp;

        @ApiModelProperty("创建时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date createTime;

        @ApiModelProperty("修改时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date updateTime;

        @ApiModelProperty("部门id 默认0(无)")
        private Long deptId;

        @ApiModelProperty("1启用")
        private Integer state;

        @ApiModelProperty("token")
        private String token;

        @ApiModelProperty("权限标识")
        private List<String> auth;

        @ApiModelProperty("菜单")
        private List<SysMenu> menu;

        @ApiModelProperty("角色")
        private Long roleId;

        @ApiModelProperty("是否是超级管理员")
        private Boolean superMan;
    }

}
